<ion-header>
  <ion-navbar no-border-bottom>
    <ion-title>
      抢单（{{datas.length}}）
    </ion-title>
    <ion-buttons end>
      <button ion-button icon-only class="font_size_large ml20" (click)="goToMap()">
        <ion-icon name="navigate">
        </ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>

</ion-header>

<ion-content (ionScroll)="scrollContent()">

  <ion-refresher (ionRefresh)="doRefresh($event)" pullMax="300" [enabled]="userInfo.SFZX!=0">
    <ion-refresher-content
      pullingText="下拉刷新"
      refreshingSpinner="circles"
      refreshingText="正在刷新...">
    </ion-refresher-content>
  </ion-refresher>

  <ng-container *ngIf="userInfo.SFZX!=0">
    <div class="w12">
      <ion-list>
        <div class="w12 bgcolor_white mb10" *ngFor="let data of datas; let i = index">
          <ion-item>
            <ion-label class="text_hide_none">
              <div class="w12 font_weight_bold">
                <span class="font_white  font_size_standard bgcolor_blue plr5 mr5 lh20">{{data.DESCRIPTION}}</span>
                <i class="fa fa-map-marker mr5" style="color:#347eff;"></i>{{data.ADDRESS}}
              </div>
              <span class="w08 mt5">{{data.NAME}} / {{data.MOBILE}}</span>
              <span class="w04 mt5 fr tr font_gray">{{data.DISTANCE != '0' ? (data.DISTANCE|distance) : ''}}</span>
              <span class="w08 mt5">{{data.ID}}</span>
              <span class="w04 mt5 fr tr font_gray font_size_standard">{{data.THRUTIME}}  {{data.YYSJD}}</span>
              <span class="w12 mt5 font_black_666 font_size_standard">备注:{{data.BZ ? data.BZ : '无'}}</span>
              <span class="w12 mt5 font_black_666 font_size_standard"
                    *ngIf="data.GUARANTEE">保修:{{data.GUARANTEE}}</span>
            </ion-label>
          </ion-item>
          <ion-item *ngFor="let pro of data.CSM_SORDERITEM">
            <ion-label class="mt10 mb10">
              <span class="w11">{{pro.EXTSKUNAME}}</span>
              <span class="w01 tr font_gray">× {{pro.LINE}}</span>
            </ion-label>
          </ion-item>
          <div class="w12 rse_list_btn">
            <button (click)="submit(data,i )">抢单</button>
          </div>
        </div>

        <div *ngIf="datasConfig.isEnd==true" class="w12 mt20 mb20 tc font_gray">------------------------ 已经到底了
          ------------------------
        </div>
        <ion-infinite-scroll (ionInfinite)="getMoreDatas($event)" threshold="100px" [enabled]="!datasConfig.isEnd">
          <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="数据加载中...">
          </ion-infinite-scroll-content>
        </ion-infinite-scroll>
      </ion-list>
    </div>
  </ng-container>
  <!--<ng-container *ngIf="userInfo.SFZX=='0'">-->
    <!--<div style="text-align: center;width: 100%;height: 100%;padding-top: 50%;padding-bottom: 50%">-->
      <!--<div padding text-center class="pt0">-->
        <!--<span class="font_gray font_size_standard">未开工无法查看到任何信息哦！</span>-->
      <!--</div>-->
      <!--<div padding text-center>-->
        <!--<button ion-fab (click)="switchIsWorking()" style="margin: 0 auto;width: 120px;height: 120px;font-size: 25px;">-->
          <!--开工-->
        <!--</button>-->
        <!--&lt;!&ndash;<i class="fa fa-lock font_gray" style="font-size: 80px;"></i>&ndash;&gt;-->
      <!--</div>-->
    <!--</div>-->
    <!--&lt;!&ndash;<ion-fab center bottom>-->
      <!--<button ion-fab (click)="switchIsWorking()">开工</button>-->
    <!--</ion-fab>&ndash;&gt;-->
  <!--</ng-container>-->
  <div [ngStyle]="{'display': userInfo.SFZX == '0'? 'block':'none'}">
    <div style="text-align: center;width: 100%;height: 100%;padding-top: 50%;padding-bottom: 50%">
      <div padding text-center class="pt0">
        <span class="font_gray font_size_standard">未开工无法查看到任何信息哦！</span>
      </div>
      <div padding text-center>
        <button ion-fab (click)="switchIsWorking()" style="margin: 0 auto;width: 120px;height: 120px;font-size: 25px;">
          开工
        </button>
        <!--<i class="fa fa-lock font_gray" style="font-size: 80px;"></i>-->
      </div>
    </div>
  </div>
  <ion-fab bottom right *ngIf="!isScrollDown && !isApp && userInfo.SFZX!='0'">
    <button ion-fab mini color="light" (click)="doRefresh()">
      <ion-icon name="md-refresh"></ion-icon>
    </button>
  </ion-fab>

</ion-content>
